package com.esri.core.analysis;

import com.esri.core.renderer.Colormap;
import com.esri.core.renderer.ColormapRenderer;

/* loaded from: classes.dex */
public class b {
    public static void a(Viewshed viewshed, ColormapRenderer colormapRenderer) {
        long id = viewshed.getId();
        if (colormapRenderer == null || colormapRenderer.getColormap() == null || id == 0) {
            return;
        }
        for (Colormap.UniqueValue uniqueValue : colormapRenderer.getColormap().getUniqueValues()) {
            if (uniqueValue != null) {
                int pixelValue = uniqueValue.getPixelValue();
                int color = uniqueValue.getColor();
                if (pixelValue == 1) {
                    viewshed.nativeSetVisibleColor(id, color);
                } else if (pixelValue == 0) {
                    viewshed.nativeSetNonVisibleColor(id, color);
                } else if (pixelValue == -1) {
                    viewshed.nativeSetNoDataColor(id, color);
                }
            }
        }
    }
}
